<template>
	<view>
		<!-- <u-cell-item icon="star-fill" title="会员等级" value="新版本" /> -->
		<view class="changguan" v-for="c in coachs" :key="c" @click="">
			<u-icon name="star-fill" />
			姓名：<text>{{c.coachName}}</text>	
			<text style="float: right;">电话：{{c.coachTel}}</text>
			<!-- <button type="button" style="float: right;"  ></button> -->
			<u-button type="info" style="float: right;"  @click="showModel(c)" size="mini">查看详情</u-button>
		</view>
		
		
		<!-- 弹出框 -->
		<u-popup v-model="show" mode="top" length="60%">
			
			<u-form :model="modelv" ref="modelv">
				<u-form-item label="编号"><u-input v-model="modelv.coachId" /></u-form-item>
				<u-form-item label="姓名"><u-input v-model="modelv.coachName" /></u-form-item>
				<u-form-item label="性别"><u-input v-model="modelv.coachSex" /></u-form-item>
				<u-form-item label="年龄"><u-input v-model="modelv.coachAge" /></u-form-item>
				<u-form-item label="电话"><u-input v-model="modelv.coachTel" /></u-form-item>
				<u-form-item label="收费"><u-input v-model="modelv.hourMoney" /></u-form-item>
			</u-form>
			
		</u-popup>
	</view>
</template>

<script>
import fullLoading from '@/components/full-loading.vue'
export default {
	data() {
		return {
			goodsList: [],
			fullLoading: false,
			//----------------------------------
			coachs:[],
			show:false,
			modelv:{
				coachId:0,
				coachName:"",
				coachSex:"",
				coachAge:0,
				coachTel:0,
				hourMoney:0,
				
				
			},
			
		}
	},
	onLoad() {
		// if (this.favGoods.length != 0) {
		// 	this.fullLoading = true
		// 	this.getGoodsList()
		// }
		
		this.myAttention();
	},
	methods: {
		//------------------------------------------------------
		//查询我关注的所有教练的方法
		myAttention(){
			this.$u.api.findAttention().then(res => {
				
				console.log(res.data);
				this.coachs=res.data;
			})
		},
		showModel(v){
			this.show=true;
			this.modelv=v;
		},
		
		
		
		
		//end ------------------------------------------------------
		getGoodsList() {
			this.$u.api.queryByGids(this.favGoods).then(res => {
				this.goodsList = res.data
				this.fullLoading = false
			})
		},
		goToDetail(gid) {
			uni.navigateTo({
				url: '../../shop/goods/detail/detail?gid=' + gid
			})
		},
		goHome(){
			uni.switchTab({
				url:'../../tabbar/index/index'
			})
		}
	},
	components: {
		fullLoading
	}
}
</script>

<style lang="scss">
page {
	// background-color: #f7f7f7;
}
.goodslist-list {
	padding: 0 20rpx;
	// margin-top: 140rpx;
	background-color: #fff;
	border-radius: 24rpx 24rpx 0 0;
	overflow: hidden;
	.item {
		margin: 30rpx 0;
		font-size: 28rpx;
		.goods-img {
			width: 252rpx;
			height: 252rpx;
			.u-wrap {
				background-color: rgba(0, 0, 0, 0.02) !important;
			}
		}
		.content {
			height: 252rpx;
			padding: 4rpx 0 2rpx 16rpx;
		}

		.title,
		.subtitle {
			width: 440rpx;
		}
		.title {
			font-size: 28rpx;
			color: #333;
			line-height: 42rpx;
		}
		.subtitle {
			font-size: 24rpx;
			color: rgb(153, 153, 153);
			margin-top: 4rpx;
			line-height: 36rpx;
		}
		.selling-point {
			text {
				display: inline-block;
				margin-right: 8rpx;
				padding: 0 12rpx;
				font-size: 22rpx;
				color: #999;
				border-radius: 36rpx;
				background-color: rgb(248, 248, 248);
			}
		}
		.price {
			margin-top: auto;
			color: rgb(227, 13, 13);
			font-size: 26rpx;
			height: 40rpx;
			font-family: 'AllAndNone';
			.priceMin {
				font-size: 34rpx;
				margin-right: 4rpx;
				font-weight: bold;
			}
			.marketPrice {
				margin-left: 6rpx;
				font-size: 24rpx;
				color: #999;
				text-decoration: line-through;
			}
			.spec {
				font-size: 24rpx;
			}
		}
		.labelbox {
			margin-top: 6rpx;
			text {
				display: inline-block;
				margin-right: 10rpx;
				padding: 0 10rpx;
				height: 32rpx;
				border-radius: 4rpx;
				text-align: center;
				color: #ffffff;
				background-color: #d96b6c;
				line-height: 32rpx;
				font-size: 24rpx;
			}
		}
		.comment {
			margin-top: 6rpx;
			font-size: 22rpx;
			color: #999;
			text {
				margin-right: 12rpx;
			}
		}
	}
}
.tips {
	align-items: center;
	margin-top: 200rpx;
	image{
		width: 180rpx;
		height: 180rpx;
	}
	.text {
		font-size: 24rpx;
		color: #666;
		margin-top: 20rpx;
	}
	.btn {
		font-size: 28rpx;
		margin-top: 40rpx;
		height: 62rpx;
		width: 196rpx;
		line-height: 62rpx;
		text-align: center;
		border-radius: 31rpx;
		background-color: #fff;
		border: 1.5rpx solid #a1a1a1;
	}
}
// .pageLoading {
// 	position: fixed;
// 	top: 40%;
// 	left: 0;
// 	// transform: translateY(-50%);
// 	width: 100%;
// 	height: 100vh;
// 	z-index: 0;
// }


//----------------------------------------
.changguan {
			line-height: 60rpx;
			height: 10%;
			width: 100%;
			background-color: #E4E7ED;
			float: left;
			font-size: 35rpx;
			margin-bottom: 5rpx;
			border-radius: 8rpx;
			//border:2rpx solid;
		}
</style>
